// index.ts
// 获取应用实例
const app = getApp<IAppOption>()

// import Toast from "@vant/weapp/toast";
import Notify from "../../miniprogram_npm/@vant/weapp/notify/notify";

Page({
  onShareAppMessage() {
    return {
      title: '社区团购',
      path: 'page/index/index'
    }
  },
  data: {
    keywords:"",
    swiper_items: [
      {
        id: "1",
        title: "小程序制作",
        pic:"http://tu.ossfiles.cn:9186/group2/M00/63/46/rBgICV4b67qAV4dnAADeYG8b-Pg873.jpg"
      },
      {
        id: "2",
        title: "微信小游戏",
        pic:
          "https://pic2.zhimg.com/v2-841fba6e60ece4cad1afdc0966ba0fdd_1200x500.jpg"
      },
      {
        id: "3",
        title: "网页制作",
        pic: "https://img.zcool.cn/community/0104045a16d7e2a8012134909a2048.png@1280w_1l_2o_100sh.png"
      },
      {
        id:"4",
        title:"erp 制作",
        pic:"https://www.xaecong.com/uploadfile/2017-3/20170307172540102.jpg"
      },
      {
        id:"5",
        title:"app 制作",
        pic:"http://img.yzt-tools.com/20200113/5afb249c1b73d1d1e51e8c85743af296.jpg"
      },
    ]
  },

  onLoad(){
    
    Notify({ type: 'success', message: '通知内容' });
  },


  // events :
  onChange(e : any) {
    this.setData({
      keywords: e.detail
    });
  },
  onCancel(){
     this.setData({
      keywords: ""
    });
  },
  onSearch() {
    var keyw = this.data.keywords;
    wx.showToast({
      title: keyw,
      // icon: 'success',
      duration: 2000
    });
  //  console.error(Toast);   
  //  Toast('搜索' + this.data.keywords);
  },
})
